package cn.fenglaicaimi.base.service.impl;

import cn.fenglaicaimi.base.domain.User;
import cn.fenglaicaimi.base.mapper.UserMapper;
import cn.fenglaicaimi.base.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service@Transactional
public class UserServiceImpl implements IUserService {
    @Autowired
    private UserMapper userMapper;


    @Override
    public void save(User user) {
        this.userMapper.insert(user);
    }

    @Override
    public User get(User user) {
        return this.userMapper.selectByUser(user);
    }

    @Override
    public int update(User user) {
        return this.userMapper.updateByPrimaryKey(user);
    }

    @Override
    public int countUser() {
        return this.userMapper.countUser();
    }
}
